<template>
  <div class="app-container calendar-list-container">
    <el-tabs type="card" v-model="activeTab">
      <!-- 产品类别配置  -->
      <el-tab-pane label="产品类别配置" name="category">
        <module-type ref="category"></module-type>
      </el-tab-pane>
      <!-- 产品树配置 -->
      <el-tab-pane label="产品树配置" name="product">
        <module-tree ref="product"></module-tree>
      </el-tab-pane>
      <!--文档树配置-->
      <el-tab-pane label="文档树配置" name="doc">
        <docdirec-tree ref="doc"></docdirec-tree>
      </el-tab-pane>
      <!--pcc树配置-->
      <el-tab-pane label="pcc树配置" name="pcc">
        <pcc-tree ref="pcc"></pcc-tree>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
  import { mapGetters } from 'vuex';
  import EditRefresh from '@/components/Mixin/editRefresh.js';

  export default {
    components: {
      'module-type': () => import('./components/moduleType'),
      'module-tree': () => import('./components/moduleTree'),
      'docdirec-tree': () => import('./components/docdirecTree'),
      'pcc-tree': () => import('./components/pccTree')
    },
    mixins: [EditRefresh],
    data() {
      return {
        activeTab: 'category'
      }
    },
    computed: {
      ...mapGetters([
        'elements'
      ])
    },
    methods: {
      refresh() {
        this.activeTab = 'category'
        this.$refs.category && this.$refs.category.refresh && this.$refs.category.refresh()
        this.$refs.product && this.$refs.product.refresh && this.$refs.product.refresh()
        this.$refs.doc && this.$refs.doc.refresh && this.$refs.doc.refresh()
        this.$refs.pcc && this.$refs.pcc.refresh && this.$refs.pcc.refresh()
      }
    }
  }
</script>
